package com.zsummer.zero.design.structure.proxy;

/**
 * 静态代理
 * @author zhouyujiang
 *
 */
public class Demo1 {

	public static void main(String[] args) {
		Person person = new Person();
		PersonProxy personProxy = new PersonProxy(person);
		personProxy.byHose();
	}
}

interface ByHouse {
	void byHose();
}

class Person implements ByHouse{

	@Override
	public void byHose() {
		System.out.println("person: pay money");
	}
	
}

class PersonProxy implements ByHouse {

	private Person person;
	
	public PersonProxy(Person person) {
		this.person = person;
	}
	
	@Override
	public void byHose() {
		System.out.println("proxy: findhouse");
		person.byHose();
		System.out.println("proxy: somecode");
		
	}
	
}
